<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>js示例4-8-3</title>
	<script>
		window.onload=function()
		{
			var text = document.getElementsByClassName("text");
			alert(text[1].innerHTML);
		}
	</script>
</head>
<body>
	<div class="text">1</div>
	<div class="text">2</div>
	<div class="text">3</div>
	<div class="text">4</div>
	<div class="text">5</div>
	<div class="text">6</div>
	<div class="text">7</div>
</body>
</html>